Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step editor improvements #297

Merged
merged 11 commits into from
Feb 23, 2024

Conversation

elluminance
Copy link
Contributor

@elluminance elluminance commented Aug 19, 2023

I have over the past few days made a few improvements to the event/action step editor.

  • Support for SHOW_MODAL_CHOICE, in a similar manner to SHOW_CHOICE (closes Event SHOW_MODAL_CHOICE not supported #246).
  • SET_MSG_EXPRESSION is now properly supported.
  • Fixed step editor from refreshing upon being updated if an event has branches/child events. (closes Typing condition in IF event step is difficult #294).
  • Better support for the previews of a variety of types: Vec2, Vec3, Offset, Entity, EnemyType, NumberExpression, StringExpression, BooleanExpression, VarName, Effect, and Animation.
    • Note: This does not add any new widgets or anything to allow easier editing of these types. Merely the preview of the properties in the step editor.
  • VarConditions now use the string editing widget as opposed to the JSON editor. (applies to the entity editor as well).
  • Player-visible text will now be properly rendered with the proper colors.

Editor before:
image
image-1

Editor after:
image
image

@elluminance elluminance marked this pull request as draft August 20, 2023 15:13
@elluminance
Copy link
Contributor Author

Added support for text color rendering as well as support for SET_MSG_EXPRESSION.

@elluminance elluminance marked this pull request as ready for review August 20, 2023 15:32
Copy link
Member

@Vegita2 Vegita2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good. Makes it definitely easier to use the event editor.

I noticed an issue with the new SHOW_MODAL_CHOICE:
text shows up as [object Object] when text is empty, should just show nothing instead
image

@lexisother
Copy link
Member

On the topic of colours... I recently found that the ones used by the real editor are all stored in the game bundle. Why don't we copy over those? For example, this can be found in game.feature.msg.plug-in:

wm.addStepColorRule(/SHOW_CHOICE/, "red");

@elluminance
Copy link
Contributor Author

While I am not against that, I do feel that does go beyond the scope of my PR and should be settled separately.

Copy link
Member

@Vegita2 Vegita2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that. I should have described it more precisely what I meant with adding types

@@ -10,7 +11,7 @@ interface AddMsgPersonData extends EventType {
}

export class AddMsgPerson extends AbstractEvent<AddMsgPersonData> {
private attributes = {
private attributes: EntityAttributes = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to add EntityAttributes everywhere. If you want to update these events you can instead extend from DefaultEvent which makes the attributes property unnecessary.

Comment on lines 169 to 176
const textColors = [
null,
'#ff6969',
'#65ff89',
'#ffe430',
'#808080',
'#ff8932',
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just tried it out ingame, here is how it looks

image

and in the editor

image

So 2 differences

  • the orange one doesn't work \c[5]
  • \c[6] is not shown ingame (but we should keep it so the user knows he made an error with the text)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I forgot that orange is only rendered in the small font by default. I'll just disable it then.
As for the \c[6] (and other invalid colors), I do agree it should remain rendered just so the user will know they made a mistake as you said. I believe that was my intent in doing it like that from the beginning.

webapp/src/app/services/phaser/entities/cc-entity.ts Outdated Show resolved Hide resolved
webapp/src/app/services/phaser/entities/cc-entity.ts Outdated Show resolved Hide resolved
webapp/src/app/services/phaser/entities/cc-entity.ts Outdated Show resolved Hide resolved
@elluminance
Copy link
Contributor Author

There, I added types to what should be everything in getPropString. I hope that's what you wanted. I also fixed all the other issues. If there's anything else you wanted instead, let me know.

@Vegita2 Vegita2 merged commit af1cd8f into CCDirectLink:master Feb 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typing condition in IF event step is difficult Event SHOW_MODAL_CHOICE not supported
5 participants